package top.sxlai.controller;

import top.sxlai.service.OpUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author : sxl
 * @date : 2024/4/7 15:48
 * @Version: 1.0
 */
@CrossOrigin
@RestController
public class UploadAvatarFileController {
    @Autowired
    private OpUserService opUserService;

    @PostMapping("/uploadAvatarFile")
    public ResponseEntity<Map<String,String>> uploadAvatarFile(@RequestParam("avatarFile") MultipartFile avatarFile, @RequestParam("userId") String userId){
        return opUserService.uploadAvatarFile(avatarFile,userId);


    }

}
